﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:telerikDocking="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
	xmlns:local="clr-namespace:Licenta3"
	xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
	mc:Ignorable="d"
	x:Class="Anexa11View"
	x:Name="UserControl"
	d:DesignWidth="640" d:DesignHeight="480" Width="400" Height="820" Background="{DynamicResource NormalBrush}" ScrollViewer.CanContentScroll="True" ScrollViewer.VerticalScrollBarVisibility="Visible">
	<UserControl.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="/Licenta3;component/Simple Styles.xaml"/>
			</ResourceDictionary.MergedDictionaries>
			<local:Anexa11ViewModel x:Key="Anexa11ViewModelDataSource" d:IsDataSource="True"/>
		</ResourceDictionary>
	</UserControl.Resources>
	<UserControl.DataContext>
		<Binding Source="{StaticResource Anexa11ViewModelDataSource}"/>
	</UserControl.DataContext>
	<ScrollViewer  VerticalScrollBarVisibility="Auto" VerticalAlignment="Top">
	<telerik:ProportionalStackPanel Orientation="Vertical" ScrollViewer.CanContentScroll="True" Height="820">
		<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
			<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="Autorizat"/></TextBlock>
			<ComboBox Margin="4" ItemsSource="{Binding Setari.lAutorizat}" SelectedItem="{Binding Anexa.Autorizat}" SelectedValue="{Binding Anexa.Autorizat.Nume}" SelectedValuePath="Nume" DisplayMemberPath="Nume"/>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
			<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="OCPI"/></TextBlock>
			<ComboBox Margin="4" ItemsSource="{Binding Setari.lists.OCPI}" DisplayMemberPath="denumire" SelectedItem="{Binding Anexa.OCPI, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SelectedValue="{Binding Anexa.OCPI.denumire}" SelectedValuePath="denumire">
				<i:Interaction.Triggers>
					<i:EventTrigger EventName="SelectionChanged">
						<i:InvokeCommandAction Command="{Binding UpdateUATImobilListCommand}"/>
					</i:EventTrigger>
				</i:Interaction.Triggers>
			</ComboBox>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
			<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="BCPI"/></TextBlock>
			<ComboBox Margin="4" SelectedItem="{Binding Anexa.BCPI, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SelectedValue="{Binding Anexa.BCPI.denumire}" ItemsSource="{Binding Anexa.OCPI.BCPI}" SelectedValuePath="denumire" DisplayMemberPath="denumire"/>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
			<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="Adresă Imobil"/></TextBlock>
			<TextBox TextWrapping="Wrap" Margin="4" Text="{Binding Anexa.Imobil.Adresa.adresaIntreaga}"/>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
			<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="UAT"/></TextBlock>
			<ComboBox Margin="4" ItemsSource="{Binding UATImobilList}" DisplayMemberPath="Denumire" SelectedItem="{Binding Anexa.Imobil.UAT, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SelectedValue="{Binding Anexa.Imobil.UAT.Denumire}" SelectedValuePath="Denumire"/>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
			<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="Proprietar"/></TextBlock>
			<TextBox TextWrapping="Wrap" Margin="4" Text="{Binding Anexa.proprietar.Nume}"/>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
			<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="Suprafață din act"/></TextBlock>
			<TextBox TextWrapping="Wrap" Margin="4" Text="{Binding Anexa.Imobil.SuprafataDinAct}"/>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
			<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="Data"/></TextBlock>
			<xctk:DateTimeUpDown Margin="4" Format="ShortDate" Text="{Binding DataPAD}" CultureInfo="ro-RO"/>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="1" Height="32" VerticalAlignment="Top" Margin="4">
			<Button Content="Selectează imobil" Margin="4" Command="{Binding SelectImobilGeometryCommand}"/>
		</UniformGrid>
		<telerik:RadGridView VerticalAlignment="Top" ItemsSource="{Binding Anexa.Imobil.Vecini}" Margin="4,4,4,-104.667" IsFilteringAllowed="False" ShowGroupPanel="False" AlternationCount="1" AutoExpandGroups="True" EditTriggers="CellClick" RowIndicatorVisibility="Collapsed" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Height="154" AutoGeneratingColumn="RadGridView_AutoGeneratingColumn_2" EnableLostFocusSelectedState="False">
			<telerik:StyleManager.Theme>
				<telerik:SummerTheme/>
			</telerik:StyleManager.Theme>
		</telerik:RadGridView>
		<telerik:RadGridView VerticalAlignment="Top"
		ItemsSource="{Binding Anexa.Imobil.Parcele, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="4,4,4,-96" IsFilteringAllowed="False" ShowGroupPanel="False" ShowInsertRow="True" AlternationCount="1" AutoExpandGroups="True" EditTriggers="CellClick" RowIndicatorVisibility="Collapsed" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Height="154" AutoGeneratingColumn="RadGridView_AutoGeneratingColumn" Focusable="False">
			<telerik:RadGridView.Columns>
				<telerik:GridViewColumn>
					<telerik:GridViewColumn.CellTemplate>
						<DataTemplate>
							<telerik:RadButton Content="Selectează"
								Command="{Binding DataContext.SelectParcelaGeometryCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:ProportionalStackPanel}}}"
								CommandParameter="{Binding}"
						/>
						</DataTemplate>
					</telerik:GridViewColumn.CellTemplate>
				</telerik:GridViewColumn>
				<telerik:GridViewColumn Header="Categorie de Folosință">
					<telerik:GridViewColumn.CellTemplate>
						<DataTemplate>
							<telerik:RadComboBox SelectedItem="{Binding CategorieFolosinta}"
							ItemsSource="{Binding CategoriiFolosinta.values.Keys, Source={StaticResource Anexa11ViewModelDataSource}}"
							/>
						</DataTemplate>
					</telerik:GridViewColumn.CellTemplate>
				</telerik:GridViewColumn>	
				<!--<telerik:GridViewComboBoxColumn Header="Categorie de Folosință"   RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:ProportionalStackPanel}}      DataMemberBinding="{Binding Anexa.Imobil.Parcele/CategorieFolosinta, Source={StaticResource Anexa11ViewModelDataSource}}" ItemsSource="{Binding CategoriiFolosinta.values.Keys}"/>
			-->
			</telerik:RadGridView.Columns>
			<telerik:StyleManager.Theme>
				<telerik:SummerTheme/>
			</telerik:StyleManager.Theme>
		</telerik:RadGridView>
		<telerik:RadGridView ItemsSource="{Binding Anexa.Imobil.Constructii}" IsFilteringAllowed="False" ShowGroupPanel="False" ShowInsertRow="True" AlternationCount="1" AutoExpandGroups="True" EditTriggers="CellClick" RowIndicatorVisibility="Collapsed" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" AutoGeneratingColumn="RadGridView_AutoGeneratingColumn_1" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Top" Height="150" Margin="4,4,4,-96" >
			<telerik:RadGridView.Columns>
				<telerik:GridViewColumn>
					<telerik:GridViewColumn.CellTemplate>
						<DataTemplate>
							<telerik:RadButton Content="Selectează"
								Command="{Binding DataContext.SelectConstructieGeometryCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:ProportionalStackPanel}}}"
								CommandParameter="{Binding}"
						/>
						</DataTemplate>
					</telerik:GridViewColumn.CellTemplate>
				</telerik:GridViewColumn>
			</telerik:RadGridView.Columns>
			<telerik:StyleManager.Theme>
				<telerik:SummerTheme/>
			</telerik:StyleManager.Theme>
		</telerik:RadGridView>
		<UniformGrid Rows="1" Columns="1" Height="32" VerticalAlignment="Top" Margin="4,4,4,0">
			<Button Content="PAD" Margin="4" Command="{Binding GenereazaPADCommand}"/>
		</UniformGrid>
		<UniformGrid Rows="1" Columns="1" Height="32" VerticalAlignment="Top" Margin="4,4,4,0">
			<Button Content="Resetează" Margin="4" Command="{Binding ResetModelCommand}"/>
		</UniformGrid>
	</telerik:ProportionalStackPanel>
	</ScrollViewer>
</UserControl>